const obj = new Proxy(
  {},
  {
    get(target, propKey, receiver) {
      console.log(`getting ${propKey}`);
      return Reflect.get(target, propKey, receiver);
    },
    set(target, propKey, value, receiver) {
      console.log(`setting ${propKey}`);
      return Reflect.set(target, propKey, value, receiver);
    },
  }
);
obj.x; // getting x
obj.x = 1; // setting x
++obj.x; // getting x, setting x
